-
Notifications
You must be signed in to change notification settings - Fork 124
fix issue with nested vector fields and python 3.13 issubclass changes #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look great! 👍 Let's keep an eye on that _is_numeric_type
function. If it ends up used elsewhere, we could consider throwing it in utils.py
and use a for loop as a performance optimization.
@@ -76,7 +76,7 @@ jobs: | |||
strategy: | |||
matrix: | |||
os: [ ubuntu-latest ] | |||
pyver: [ "3.9", "3.10", "3.11", "3.12", "pypy-3.9", "pypy-3.10" ] | |||
pyver: [ "3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.9", "pypy-3.10" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, we definitely needed to test against 3.13
That makes more sense, I'll go ahead and throw it in there now to set a precedence for functions like that going forward. |
The main purpose of this PR is to support python 3.13.
There is a change to
issubclass
where if you feed in a type likelist[float]
, it will raise a type error because it does not validate that the inner types arefloat
s and so it now raises an error instead of possibly returning a false positive.In troubleshooting this, we also came across this PR: #674 from @huwaizatahir2, making this change (and updating the field to be
list[float]
instead oflist[list[float]]
also resolved the issue we were facing.For backwards compatibility, we still allow
list[list[float]]
but we wanted to also support what is probably the correct way of defining vector fields which islist[float]
.We also kept running into the flaky test from
tests/test_hash_model.py::test_pagination_queries
so we went ahead and pulled in the fix from this PR: #694This PR should now make it possible to use
redis-om
with python 3.13 as well as fix the issues associated with the other 2 PRs tagged above.